﻿using Music.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Music.VariableTemplate
{
    public class VariableStyles : StyleSelector
    {
        protected override Windows.UI.Xaml.Style SelectStyleCore(object item, Windows.UI.Xaml.DependencyObject container)
        {
            FrameworkElement element = container as FrameworkElement;
            if (item != null && element != null)
            {
                if (item.GetType() == typeof(HubPageDataItem))
                {
                    if ((item as HubPageDataItem).UniqueId.StartsWith("Big"))
                        return App.Current.Resources["StaticItemContainerStyle"] as Style;
                    if ((item as HubPageDataItem).UniqueId.StartsWith("Featured"))
                        return App.Current.Resources["StaticItemContainerStyle"] as Style;
                }
            }
            return base.SelectStyleCore(item, container);
        }
    }
}

